home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 122 / MOBICLIC 122.ISO / mac / DATA / DSS122 / DSS122_04 / DSS122_04.swf / scripts / frame_110 / DoAction.as
Text File  |  2010-02-18  |  6KB  |  207 lines

  1. function stopGui()
  2. {
  3.    _root.GUILLAUMET_JEU.gotoAndStop("E1");
  4.    if(countEl == 7)
  5.    {
  6.       gotoAndStop("FIN_01");
  7.    }
  8. }
  9. stop();
  10. if(_global.HOTE.gListeLettres_DSS122[8] == 1)
  11. {
  12.    LETTRE_09._visible = 0;
  13. }
  14. if(_global.HOTE.gListeLettres_DSS122[9] == 1)
  15. {
  16.    LETTRE_05._visible = 0;
  17. }
  18. var i = 9;
  19. while(i <= 10)
  20. {
  21.    this["LETTRE_" + gimme2digits(i)].pLettre = i;
  22.    this["LETTRE_" + gimme2digits(i)].onRollOver = function()
  23.    {
  24.       if(_root.drag == undefined)
  25.       {
  26.          this.gotoAndStop("E2");
  27.          joueBruitage({nomSon:"B_LETTRE"});
  28.          gereCursor(3);
  29.       }
  30.    };
  31.    this["LETTRE_" + gimme2digits(i)].onRollOut = function()
  32.    {
  33.       if(_root.drag == undefined)
  34.       {
  35.          this.gotoAndStop("E1");
  36.          stopBruitage({nomSon:"B_LETTRE"});
  37.          gereCursor(1);
  38.       }
  39.    };
  40.    this["LETTRE_" + gimme2digits(i)].onPress = function()
  41.    {
  42.       if(_root.drag == undefined)
  43.       {
  44.          stopBruitage({nomSon:"B_LETTRE"});
  45.          gereCursor(1);
  46.          _root.drag = this.pLettre;
  47.          this.origX = this._x;
  48.          this.origY = this._y;
  49.          this.diffX = _root._xmouse - this._x;
  50.          this.diffY = _root._ymouse - this._y;
  51.          this.origDepth = this.getDepth();
  52.          this.swapDepths(10);
  53.       }
  54.    };
  55.    this["LETTRE_" + gimme2digits(i)].onRelease = this["LETTRE_" + gimme2digits(i)].onReleaseOutside = function()
  56.    {
  57.       if(_root.drag == this.pLettre)
  58.       {
  59.          if(this.overSac == 1)
  60.          {
  61.             joueBruitage({nomSon:"B_SUCCES"});
  62.             this._visible = 0;
  63.             _global.HOTE.gListeLettres_DSS122[this.pLettre - 1] = 1;
  64.          }
  65.          else if(this.overGui == 1)
  66.          {
  67.             joueSon({nomSon:"02_BAD_LETTRE09",actionFin:"stopGui"});
  68.             _root.GUILLAUMET_JEU.gotoAndStop("E4");
  69.             this._x = this.origX;
  70.             this._y = this.origY;
  71.          }
  72.          else
  73.          {
  74.             joueBruitage({nomSon:"B_ECHEC"});
  75.             this._x = this.origX;
  76.             this._y = this.origY;
  77.          }
  78.          this.swapDepths(this.origDepth);
  79.          _root.drag = undefined;
  80.          this.gotoAndStop("E1");
  81.       }
  82.    };
  83.    this["LETTRE_" + gimme2digits(i)].onEnterFrame = function()
  84.    {
  85.       if(_root.drag == this.pLettre)
  86.       {
  87.          this._x = _root._xmouse - this.diffX;
  88.          this._y = _root._ymouse - this.diffY;
  89.          if(_root.SAC.hitTest(_root._xmouse,_root._ymouse,1))
  90.          {
  91.             this.gotoAndStop("E1");
  92.             this.overSac = 1;
  93.             this.overGui = 0;
  94.          }
  95.          else if(_root.GUILLAUMET_JEU.hitTest(_root._xmouse,_root._ymouse,1))
  96.          {
  97.             this.gotoAndStop("E1");
  98.             _root.GUILLAUMET_JEU.gotoAndStop("E2");
  99.             this.overGui = 1;
  100.             this.overSac = 0;
  101.          }
  102.          else
  103.          {
  104.             this.gotoAndStop("E2");
  105.             _root.GUILLAUMET_JEU.gotoAndStop("E1");
  106.             this.overSac = 0;
  107.             this.overGui = 0;
  108.          }
  109.       }
  110.    };
  111.    i++;
  112. }
  113. countEl = 0;
  114. var i = 1;
  115. while(i <= 15)
  116. {
  117.    this["EL_" + gimme2digits(i)].pEl = i;
  118.    this["EL_" + gimme2digits(i)].onRollOver = function()
  119.    {
  120.       if(_root.drag == undefined)
  121.       {
  122.          this.gotoAndStop("E2");
  123.          joueBruitage({nomSon:"B_EL"});
  124.          gereCursor(3);
  125.       }
  126.    };
  127.    this["EL_" + gimme2digits(i)].onRollOut = function()
  128.    {
  129.       if(_root.drag == undefined)
  130.       {
  131.          this.gotoAndStop("E1");
  132.          stopBruitage({nomSon:"B_LETTRE"});
  133.          gereCursor(1);
  134.       }
  135.    };
  136.    this["EL_" + gimme2digits(i)].onPress = function()
  137.    {
  138.       if(_root.drag == undefined)
  139.       {
  140.          stopBruitage({nomSon:"B_LETTRE"});
  141.          gereCursor(1);
  142.          _root.drag = this.pEl;
  143.          this.origX = this._x;
  144.          this.origY = this._y;
  145.          this.diffX = _root._xmouse - this._x;
  146.          this.diffY = _root._ymouse - this._y;
  147.          this.origDepth = this.getDepth();
  148.          this.swapDepths(10);
  149.       }
  150.    };
  151.    this["EL_" + gimme2digits(i)].onRelease = this["EL_" + gimme2digits(i)].onReleaseOutside = function()
  152.    {
  153.       if(_root.drag == this.pEl)
  154.       {
  155.          if(this.overGui == 1)
  156.          {
  157.             if(this.pEl <= 7)
  158.             {
  159.                joueSon({nomSon:"02_OK_" + gimme2digits(this.pEl),actionFin:"stopGui"});
  160.                _root.GUILLAUMET_JEU.gotoAndStop("E3");
  161.                this._visible = 0;
  162.                _root.countEl += 1;
  163.             }
  164.             else
  165.             {
  166.                joueSon({nomSon:"02_BAD_" + gimme2digits(this.pEl),actionFin:"stopGui"});
  167.                _root.GUILLAUMET_JEU.gotoAndStop("E4");
  168.                this._x = this.origX;
  169.                this._y = this.origY;
  170.             }
  171.          }
  172.          else
  173.          {
  174.             joueBruitage({nomSon:"B_ECHEC"});
  175.             this._x = this.origX;
  176.             this._y = this.origY;
  177.          }
  178.          this.swapDepths(this.origDepth);
  179.          _root.drag = undefined;
  180.          this.gotoAndStop("E1");
  181.       }
  182.    };
  183.    this["EL_" + gimme2digits(i)].onEnterFrame = function()
  184.    {
  185.       if(_root.drag == this.pEl)
  186.       {
  187.          this._x = _root._xmouse - this.diffX;
  188.          this._y = _root._ymouse - this.diffY;
  189.          if(_root.GUILLAUMET_JEU.hitTest(_root._xmouse,_root._ymouse,1))
  190.          {
  191.             this.gotoAndStop("E1");
  192.             _root.GUILLAUMET_JEU.gotoAndStop("E2");
  193.             this.overGui = 1;
  194.             this.overSac = 0;
  195.          }
  196.          else
  197.          {
  198.             this.gotoAndStop("E2");
  199.             _root.GUILLAUMET_JEU.gotoAndStop("E1");
  200.             this.overSac = 0;
  201.             this.overGui = 0;
  202.          }
  203.       }
  204.    };
  205.    i++;
  206. }
  207.